package it.trekker.upload.json;

import java.io.Serializable;
import java.util.Date;

import com.google.gson.annotations.SerializedName;


public class ExcursionCoordinateUploaded implements Serializable {
	
	private long id;
	@SerializedName("coordinate")
	private GPSCoordinateUploaded coordinate;
	private Date timestamp;
	private long excursionId;
	
	public ExcursionCoordinateUploaded() {
	}
	
	public long getId() {
		return id;
	}
	
	public void setId(long id) {
		this.id = id;
	}
	
	public GPSCoordinateUploaded getCoordinate() {
		return coordinate;
	}

	public void setCoordinate(GPSCoordinateUploaded coordinate) {
		this.coordinate = coordinate;
	}

	public Date getTimestamp() {
		return timestamp;
	}
	
	public void setTimestamp(Date timestamp) {
		this.timestamp = timestamp;
	}
	
	public long getExcursionId() {
		return excursionId;
	}
	
	public void setExcursionId(long excursionId) {
		this.excursionId = excursionId;
	}
	
	@Override
	public String toString() {
		return String.format("id: %d - time: %s - exc: %d - %s", 
				id, timestamp, excursionId, coordinate);
	}
	
	@Override
	public boolean equals(Object o) {
		if(o == null)
			return false;
		if(this == o)
			return true;
		if(!(o instanceof ExcursionCoordinateUploaded))
			return false;
		
		ExcursionCoordinateUploaded other = (ExcursionCoordinateUploaded) o;
		
		if(this.coordinate != other.coordinate)
			return false;
		if(this.excursionId != other.excursionId)
			return false;
		if(!this.timestamp.equals(other.timestamp))
			return false;
		
		return true;
	}
}
